<template>
  <div id="app">
    <router-view v-if="isShow" />
  </div>
</template>

<script>
export default {
  name: "App",
  data() {
    return {
      // 控制router-view的隐藏与展示
      isShow: true
    };
  },
  // 提供可注入子组件属性
  provide() {
    return {
      reload: this.reload
    };
  },
  created() {},
  // 定义reload方法
  methods: {
    reload() {
      // 先隐藏
      this.isShow = false;

      // $nextTick() 将回调延迟到下次 DOM 更新循环之后执行
      this.$nextTick(() => {
        this.isShow = true;
      });
    }
  }
};
</script>
<style>
/* title样式 */
.titleInfo {
  margin: 0;
  font-size: 16px;
  text-indent: 20px;
  font-weight: 500;
  color: #1d2023;
  height: 60px;
  line-height: 60px;
  border-bottom: 1px solid #e6e9f0;
  margin-bottom: 20px;
}
/* input的border */
.borderNone > input {
  border: 0 none;
}
.spanToInput {
  color: #606266;
}
.switchStyle > .el-switch__core {
  cursor: pointer !important;
}
.switchStyleOpa {
  opacity: 1 !important;
}
.dialogColor .el-dialog__body {
  padding-top: 0px !important;
  background: #f7f7f7 !important;
}
/* .spanToInput{color: #606266;padding: 0 15px;} */
</style>
